package com.platform.dao;

import com.platform.pojo.Menu;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

public interface MenuMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(Menu record);

    int insertSelective(Menu record);

    Menu selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(Menu record);

    int updateByPrimaryKey(Menu record);


    List<Map> selectByUserNameAndParentId(@Param(value = "userName") String userName, @Param(value = "parentId") Integer parentId);

    Integer countByUserNameAndParentId(@Param(value = "userName") String userName,
                                       @Param(value = "parentId") Integer parentId);

    /**
     * 根据父节点ID查询节点
     * @param parentId
     * @return
     */
    List<Map> selectAllByAndparentId(@Param(value = "parentId") Integer parentId);

    String selectByRoleCode(String roleCode);

    List<Map> selectByParam(Map paramMap);

    List<Map> selectAllFirstMenu();
}